//
//  Hot_countryCollectionViewCell.m
//  AroundTheWorld
//
//  Created by dllo on 16/5/18.
//  Copyright © 2016年 IfelseGo an. All rights reserved.
//

#import "Hot_countryCollectionViewCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation Hot_countryCollectionViewCell


-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self doSometing];
    }
    return self;
}

-(void)doSometing{
    
    self.photoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    self.photoImageV.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.photoImageV];
    
    self.cnnameLabel = [self addLabel:18];
    self.cnnameLabel.frame = CGRectMake(WIDTH / 150 * 10, HEIGHT / 230 * 180, WIDTH  - 20, HEIGHT / 230 * 25);
    self.cnnameLabel.textColor = [UIColor whiteColor];
    
    self.ennameLabel = [self addLabel:14];
    self.ennameLabel.frame = CGRectMake(WIDTH / 150 * 10, HEIGHT / 230 * 200, WIDTH  - 20, HEIGHT / 230 * 20);
    self.ennameLabel.textColor = [UIColor whiteColor];
    
    UILabel *label = [self addLabel:1];
    label.frame =CGRectMake(WIDTH / 150 * 100 , HEIGHT / 230 * 10, WIDTH / 150 * 43, HEIGHT / 230 * 60);
    label.backgroundColor = [UIColor blackColor];
    label.alpha = 0.5;
    label.layer.masksToBounds = YES;
    label.layer.cornerRadius = 3;
    
    self.countLabel = [self addLabel:22];
    self.countLabel.frame = CGRectMake(WIDTH / 150 * 100 , HEIGHT / 230 * 10, WIDTH / 150 * 43, HEIGHT / 230 * 35);
    self.countLabel.alpha = 0.5;
    self.countLabel.textColor = [UIColor whiteColor];
    self.countLabel.textAlignment = NSTextAlignmentCenter;
    
    self.labelLabel = [self addLabel:16];
    self.labelLabel.frame = CGRectMake(WIDTH / 150 * 100 , HEIGHT / 230 * 40, WIDTH / 150 * 43, HEIGHT / 230 * 25);
    self.labelLabel.alpha = 0.5;
    self.labelLabel.textColor = [UIColor whiteColor];
    self.labelLabel.textAlignment = NSTextAlignmentCenter;
}

- (UILabel *)addLabel:(NSInteger )fontSize{
    UILabel *label = [[UILabel alloc] init];
    label.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:label];
    label.font = [UIFont systemFontOfSize:fontSize];
    return label;
}


@end
